package core;


import java.awt.image.Raster;
import java.awt.image.WritableRaster;


public abstract class AbstractImageProcessor implements IImageProcessor, IPixelProcessor {

	@Override
	public void process(Raster source, WritableRaster dest) {
		int numBands = source.getNumBands();
		int[] pixel = new int[numBands];
		
		for(int x=0; x<source.getWidth(); x++) {
			for(int y=0; y<source.getHeight(); y++) {
				source.getPixel(x, y, pixel);
				processPixel(pixel, x, y);
				dest.setPixel(x, y, pixel);
			}
		}
	}

}
